package com.choupin.choupin.admin.mapper;

import com.choupin.choupin.admin.entity.LotteryAndTurntable;
import com.choupin.choupin.entity.Turntable;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDateTime;
import java.util.List;

public interface ManageTurntableMapper {
//    显示转盘列表
     List<Turntable> showTurntables(@Param("currentPage") Integer currentPage,
                                    @Param("pageSize") Integer pageSize);

//    联合查询
     List<LotteryAndTurntable> selectTurntables(@Param("id") Integer id,
                                                @Param("idStr") String idStr,
                                                @Param("prizeName") String prizeName,
                                                @Param("name") String name
                                                 );

//     删除转盘分片
      Integer deleteTurntable(Integer id);

//    添加转盘分片
     void  addTurntables(Turntable turntable);

    //    更新图片
    Integer updateImage(@Param("id") Integer id ,
                        @Param("image") String image,
                        @Param("phone") String phone,
                        @Param("time") LocalDateTime time
    );

//    根据转盘分片和抽奖池id搜索转盘表
    Turntable selectById(@Param("turntableId") Integer turntableId,
                         @Param("poolId") Integer poolId
                               );

//    显示转盘详细信息
    Turntable showUpdate(Integer id);

//    更新转盘数据
    Integer updateTurntable(@Param("id") Integer id,
                            @Param("prizeName") String prizeName,
                            @Param("amount") Long amount,
                            @Param("amountStr") String amountStr,
                            @Param("exchangeTime") LocalDateTime exchangeTime,
                            @Param("exchangeTimeStr") String exchangeTimeStr,
                            @Param("phone") String Phone,
                            @Param("time") LocalDateTime time);

//  根据Poolid删除转盘数据
  Integer deleteTurntablesByPoolId(Integer poolId);

}
